package com.example.lp.lpuicore.views;

import android.content.Context;
import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.Toast;

import com.example.lp.lpuicore.R;
import com.example.lp.lpuicore.views.drawable.DrawableActivity;
import com.example.lp.lpuicore.views.touch.screencheck.ScreenCheckActivity;
import com.example.lp.lpuicore.views.ui.UiActivity;
import com.example.lp.lpuicore.views.view.ViewAboutActivity;
import com.example.lp.lpuicore.views.viewgroup.ScaleActivity;
import com.example.lp.lpuicore.views.viewgroup.ViewGroupActivity;

public class ViewActivity extends AppCompatActivity {
    private static final String TAG="ViewActivity";
    private LayoutInflater mInflater ;
    private Context context;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_view);
        context=this;
        initViews();
    }

    private void initViews() {
        mInflater = LayoutInflater.from(this);
        findViewById(R.id.tv_BaseView).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Toast.makeText(context,"BaseView",Toast.LENGTH_SHORT).show();
                startActivity(new Intent(context, ViewAboutActivity.class));
            }
        });
        findViewById(R.id.tv_FlowLayout).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Log.i(TAG, "onClick:tv_FlowLayout ");
                startActivity(new Intent(context, ViewGroupActivity.class));
            }
        });
        findViewById(R.id.tv_screen).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Log.i(TAG, "onClick:tv_FlowLayout ");
                startActivity(new Intent(context, ScreenCheckActivity.class));
            }
        });
        findViewById(R.id.tv_scale).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Log.i(TAG, "onClick:tv_scale ");
                startActivity(new Intent(context, ScaleActivity.class));
            }
        });
        findViewById(R.id.btn_drawable).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Log.i(TAG, "onClick:btn_drawable ");
                startActivity(new Intent(context, DrawableActivity.class));
            }
        });
        findViewById(R.id.btn_ui).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Log.i(TAG, "onClick:btn_ui ");
                startActivity(new Intent(context, UiActivity.class));
            }
        });
    }
}
